package com;

import javax.swing.*;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;

public class TetrisMain extends JFrame {
    //主边框（界面）设定
    JTextField textField;
    public TetrisMain() {
        setTitle("俄罗斯方块");
        setLayout(null);
        setSize(400,600);
        setVisible(true);
        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        setLocation(300,100);
        GamePanel gamePanel=new GamePanel();
        add(gamePanel);

        gamePanel.setFocusable(true);
        addKeyListener(new KeyAdapter() {
            @Override
            public void keyPressed(KeyEvent e) {
                super.keyPressed(e);
            }
        });
    }

    public static void main(String[] args) {
        SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                new TetrisMain();
            }
        });
    }
}
